package cn.com.http.httpheader;

public class HttpHeader {
	private final String name;
	private final String value;

	public HttpHeader(String name, String value) {
		if (name == null || value == null)
			throw new NullPointerException();
		this.name = name;
		this.value = value;
	}

	public HttpHeader(String name, Object value){
		this(name, value.toString());
	}

	public String getName(){
		return name;
	}

	public String getValue(){
		return value;
	}
	public String toString(){
		return getName() + ": " + getValue();
	}

	public boolean hasName(String name){
		return this.name.equalsIgnoreCase(name);
	}
}
